/**
 * model
 *
 * @param
 */
const fs = require('fs');
const path = require('path');

var model = {};

// read all mmodels and import them into the "model" object
fs
  .readdirSync(__dirname + '/')
  .filter(file => {
    return file.indexOf('.') !== 0 && file !== 'index.js';
  })
  .forEach(fileName => {
    const pathName = __dirname + '/' + fileName;
    const file = path.parse(pathName);
    Object.defineProperty(model, file.name, { get: () => require(pathName) });
  });

module.exports = model;